package com.google.code.sms.command;

import java.util.Date;

import com.google.code.sms.controller.PlayerSettingsController;
import com.google.code.sms.domain.CoverArtScheme;
import com.google.code.sms.domain.Player;
import com.google.code.sms.domain.PlayerTechnology;

/**
 * Command used in {@link PlayerSettingsController}.
 *
 * @author Sindre Mehus
 */
public class PlayerSettingsCommand {

    private String playerId;
    private String name;
    private String description;
    private String type;
    private Date lastSeen;
    private boolean isDynamicIp;
    private boolean isAutoControlEnabled;
    private String coverArtSchemeName;
    private String technologyName;
    private EnumHolder[] technologyHolders;
    private EnumHolder[] coverArtSchemeHolders;
    private Player[] players;
    private boolean isAdmin;
    private boolean isReloadNeeded;

    public String getPlayerId() {
        return playerId;
    }

    public void setPlayerId(String playerId) {
        this.playerId = playerId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getLastSeen() {
        return lastSeen;
    }

    public void setLastSeen(Date lastSeen) {
        this.lastSeen = lastSeen;
    }

    public boolean isDynamicIp() {
        return isDynamicIp;
    }

    public void setDynamicIp(boolean dynamicIp) {
        isDynamicIp = dynamicIp;
    }

    public boolean isAutoControlEnabled() {
        return isAutoControlEnabled;
    }

    public void setAutoControlEnabled(boolean autoControlEnabled) {
        isAutoControlEnabled = autoControlEnabled;
    }

    public String getCoverArtSchemeName() {
        return coverArtSchemeName;
    }

    public void setCoverArtSchemeName(String coverArtSchemeName) {
        this.coverArtSchemeName = coverArtSchemeName;
    }

    public EnumHolder[] getTechnologyHolders() {
        return technologyHolders;
    }

    public void setTechnologies(PlayerTechnology[] technologies) {
        technologyHolders = new EnumHolder[technologies.length];
        for (int i = 0; i < technologies.length; i++) {
            PlayerTechnology technology = technologies[i];
            technologyHolders[i] = new EnumHolder(technology.name(), technology.toString());
        }
    }

    public EnumHolder[] getCoverArtSchemeHolders() {
        return coverArtSchemeHolders;
    }

    public void setCoverArtSchemes(CoverArtScheme[] coverArtSchemes) {
        coverArtSchemeHolders = new EnumHolder[coverArtSchemes.length];
        for (int i = 0; i < coverArtSchemes.length; i++) {
            CoverArtScheme scheme = coverArtSchemes[i];
            coverArtSchemeHolders[i] = new EnumHolder(scheme.name(), scheme.toString());
        }
    }

    public String getTechnologyName() {
        return technologyName;
    }

    public void setTechnologyName(String technologyName) {
        this.technologyName = technologyName;
    }

    public Player[] getPlayers() {
        return players;
    }

    public void setPlayers(Player[] players) {
        this.players = players;
    }

    public boolean isAdmin() {
        return isAdmin;
    }

    public void setAdmin(boolean admin) {
        isAdmin = admin;
    }

    public boolean isReloadNeeded() {
        return isReloadNeeded;
    }

    public void setReloadNeeded(boolean reloadNeeded) {
        isReloadNeeded = reloadNeeded;
    }
}